<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('系统管理员操作界面')"/>
    <link th:href="@{/ruoyi/css/font-awesome.css}" rel="stylesheet"/>
    <link th:href="@{/ruoyi/css/jquery-confirm.min.css}" rel="stylesheet"/>
</head>
<style type="text/css">
    .qbinput{
        margin: -10% 0px 0px 0px;
        float: right;
        width: 80%;
    }
    .labkz{
        margin-top: 10px;
        float: left;
    }
    #ipdz_id {
        width: 80%;
        margin: -30px 0px 0px 0px;
        height: 32px;
        float: right;
        border: none;
        border-bottom: 1px solid #e5e6e7;
    }
    #ipdz_id > input {
        height: 21px;
        width: 32.3px;
        border: none;
        text-align: center;
    }
    #ipdz_id > input[readonly] {
        background-color: #EEEEEE;
    }

    #macdz_id {
        width: 80%;
        margin: -30px 0px 0px 0px;
        height: 32px;
        float: right;
        border: none;
        border-bottom: 1px solid #e5e6e7;
    }
    #macdz_id > input {
        height: 21px;
        width: 26.3px;
        border: none;
        text-align: center;
    }
    #macdz_id > input[readonly] {
        background-color: #EEEEEE;
    }
    .bminput{
        margin: -10% 31% 0px 0px;
        float: right;
        width: 49%;
    }
    .shiyrinput{
        margin: -10% 0px 0px 0px;
        float: right;
        width: 30%;
    }
    .gmrqdiv{
        margin-right: 4%; width:72%;float: right
    }
    .rowdiv{
        margin-top: -2%;
    }
</style>
<body class="gray-bg" style="width: 95%;margin: 0px auto">
<div class="container-div">
    <form id="form-sb-add" class="form-horizontal">
        <div class="row">
            <div class="form-group">
                <h1><strong>修改设备</strong></h1>
            </div>
        </div>
        <div class="row rowdiv">
            <div class="form-group">
                <label class="col-sm-2 control-label labkz">公司名称</label>
                <div class="col-sm-2">
                    <input type="text" readonly="readonly" class="form-control qbinput" id="gsid_update" th:value="${session.gsid}!=''?${session.gsid}:''"
                           name="gsid" style="background-color: #ffffff">
                </div></div></div>
        <div class="row rowdiv">
            <div class="form-group">
                <label class="col-sm-2 control-label labkz">设备名称</label>
                <div class="col-sm-2">
                    <input name="sbmc" id="sbmc_update" class="form-control qbinput" type="text" th:value="${session.sbmc}!=''?${session.sbmc}:''"
                           readonly="readonly" style="background-color: #ffffff">
                </div></div></div>
        <div class="row rowdiv">
            <div class="form-group">
                <label class="col-sm-2 control-label labkz">设备编号</label>
                <div class="col-sm-2">
                    <input name="sbbh" id="sbbh_update" class="form-control qbinput" type="text" th:value="${session.sbbh}!=''?${session.sbbh}:''"
                           readonly="readonly" style="background-color: #ffffff">
                </div>
            </div>
        </div>
        <div class="row rowdiv">
            <div class="form-group">
                <label class="col-sm-2 control-label labkz">品牌型号</label>
                <div class="col-sm-2">
                    <input name="guige" id="guige_update" class="form-control qbinput" type="text" th:value="${session.guige}!=''?${session.guige}:''">
                </div></div></div>
        <div class="row rowdiv">
            <div class="form-group">
                <label class="col-sm-2 control-label labkz">生产厂家</label>
                <div class="col-sm-2">
                    <input name="shccj" id="shccj_update" class="form-control qbinput" type="text" th:value="${session.shccj}!=''?${session.shccj}:''">
                </div></div></div>
        <div class="row rowdiv">
            <div class="form-group">
                <label class="col-sm-2 control-label labkz">购买日期</label>
                <div class="col-sm-2 input-group date gmrqdiv">
                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    <input name="gmrq" id="gmrq_update" class="form-control" type="text" th:value="${session.gmrq}!=''?${session.gmrq}:''"
                           readonly="readonly" style="background-color: #FFFFFF;">
                </div>
            </div>
        </div>
        <div class="row rowdiv">
            <div class="form-group">
                <label class="col-sm-2 control-label labkz">主板型号</label>
                <div class="col-sm-1">
                    <input name="zbxh" id="zbxh_update" class="form-control qbinput" type="text" th:value="${session.zbxh}!=''?${session.zbxh}:''">
                </div>
            </div></div>
        <div class="row rowdiv">
            <div class="form-group">
                <label class="col-sm-2 control-label labkz">CPU型号</label>
                <div class="col-sm-1">
                    <input name="cpuxh" id="cpuxh_update" class="form-control qbinput" type="text" th:value="${session.cpuxh}!=''?${session.cpuxh}:''">
                </div></div></div>
        <div class="row rowdiv">
            <div class="form-group">
                <label class="col-sm-2 control-label labkz">显&nbsp;&nbsp;示&nbsp;&nbsp;器</label>
                <div class="col-sm-1">
                    <input name="xsqppcc" class="form-control qbinput" id="xsqppcc_update "  th:value="${session.xsqppcc}!=''?${session.xsqppcc}:''">
                    <span class="help-block"></span>
                </div>
            </div>
        </div>
        <div class="row rowdiv">
            <div class="form-group">
                <label class="col-sm-2 control-label labkz">显卡型号</label>
                <div class="col-sm-1">
                    <input name="xkxh" id="xkxh_update" class="form-control qbinput" type="text" th:value="${session.xkxh}!=''?${session.xkxh}:''">
                </div></div></div>
        <div class="row rowdiv">
            <div class="form-group">
                <label class="col-sm-2 control-label labkz">内存大小</label>
                <div class="col-sm-1">
                    <input name="ncggdx" id="ncggdx_update" class="form-control qbinput" type="text" th:value="${session.ncggdx}!=''?${session.ncggdx}:''"
                           onkeyup="if(this.value.length==1){this.value=this.value.replace(/[^1-9]/g,'')}else{this.value=this.value.replace(/\D/g,'')}"
                           onafterpaste="if(this.value.length==1){this.value=this.value.replace(/[^1-9]/g,'')}else{this.value=this.value.replace(/\D/g,'')}">
                </div>
            </div></div>
        <div class="row rowdiv">
            <div class="form-group">
                <label class="col-sm-2 control-label labkz">硬盘信息</label>
                <div class="col-sm-1">
                    <input name="ypdx" id="ypdx_update_1" class="form-control qbinput" type="text" >
                </div>
            </div>
        </div>
        <div class="row rowdiv">
            <div class="form-group">
                <label class="col-sm-2 control-label labkz">IP&nbsp;&nbsp;地&nbsp;&nbsp;址</label>
                <div class="col-sm-1" id="ipdz_id" >
                    <input type="text" id="ipdz1" class="ip1" maxlength="3" >.<input
                        type="text" id="ipdz2" class="ip2" maxlength="3" >.<input
                        type="text" id="ipdz3" class="ip3" maxlength="3" >.<input
                        type="text" id="ipdz4" class="ip4" maxlength="3" >
                </div>
                <input type="hidden" name="ipdz" id="ip">
            </div></div>
        <div class="row rowdiv">
            <div class="form-group">
                <label class="col-sm-2 control-label labkz">MAC地址</label>
                <div class="col-sm-1" id="macdz_id">
                    <input type="text" value="" class="mac1" maxlength="2" style="width: 25px">-
                    <input type="text" value="" class="mac2" maxlength="2" style="width: 25px">-
                    <input type="text" value="" class="mac3" maxlength="2" style="width: 25px">-
                    <input type="text" value="" class="mac4" maxlength="2" style="width: 25px">-
                    <input type="text" value="" class="mac5" maxlength="2" style="width: 25px">-
                    <input type="text" value="" class="mac6" maxlength="2" style="width: 25px">
                </div>
                <input type="hidden" name="macdz" id="mac">
            </div></div>
        <div class="row rowdiv">
            <div class="form-group">
                <label class="col-sm-2 control-label labkz">硬盘信息</label>
                <div class="col-sm-1">
                    <input name="ypdx" id="ypdx_update_2" class="form-control qbinput" type="text" >
                </div>
            </div>
        </div>
        <div class="row rowdiv">
            <div class="form-group">
                <label class="col-sm-2 control-label labkz">使用部门</label>
                <div class="col-sm-1">
                    <select name="bm" class="form-control m-b bminput" id="bmid_id" onchange="getry()">
                    </select>
                </div>
                <div class="col-sm-1">
                    <input name="shiyr" id="shiyr_id" class="form-control shiyrinput" list="browsers" placeholder="姓名拼音" th:value="${session.shiyr}!=''?${session.shiyr}:''">
                    <datalist id="browsers"></datalist>
                    <span class="help-block"></span>
                </div>
            </div></div>
        <div class="row rowdiv">
            <div class="form-group">
                <label class="col-sm-2 control-label labkz">显示器日期</label>
                <div class="col-sm-2 input-group date gmrqdiv">
                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    <input name="xsqgmrq" id="xsqgmrq_update" class="form-control" type="text" th:value="${session.xsqgmrq}!=''?${session.xsqgmrq}:''"
                           readonly="readonly" style="background-color: #FFFFFF;">
                </div>
            </div>
        </div>
        <div class="row rowdiv">
            <div class="form-group">
                <label class="col-sm-2 control-label labkz">备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注</label>
                <div class="col-sm-10">
                    <input name="beiz" id="beiz_update" class="form-control qbinput" type="text" th:value="${session.beiz}!=''?${session.beiz}:''">
                </div>
            </div>
        </div>
        <div class="row rowdiv">
            <div class="form-group">
                <label class="col-sm-2 control-label labkz">升级备注</label>
                <div class="col-sm-10">
                    <input name="sjbeiz" id="sjbeiz_update" class="form-control qbinput" type="text" th:value="${session.sjbeiz}!=''?${session.sjbeiz}:''">
                </div>
            </div>
        </div>
        <div class="row rowdiv">
            <div class="form-group">
                <label class="col-sm-2 control-label labkz">报废备注</label>
                <div class="col-sm-10">
                    <input name="bfbeiz" id="bfbeiz_update" class="form-control qbinput" type="text" th:value="${session.bfbeiz}!=''?${session.bfbeiz}:''">
                </div>
            </div>
        </div>
        <div class="row rowdiv">
            <div class="form-group">
                <label class="col-sm-2 control-label labkz">硬盘信息</label>
                <div class="col-sm-1">
                    <input name="ypdx" id="ypdx_update_3" class="form-control qbinput" type="text" >
                </div>
                <p style="display: none" id="pgsid">[[${session.gsid}]]</p>
                <p id="xiu_id">[[${id}]]</p>
            </div>
        </div>
        <div class="row">
            <div class="form-group">
                <div class="modal-footer" style="height:0px">
                    <button type="button" class="btn btn-white" id="sb_update_btn" onclick="updatesb()">保存
                    </button>
                </div>
            </div>
        </div>
    </form>
</div>
<div><input type="hidden" id="_pageNumber"></div>
<div><input type="hidden" id="_pageSize"></div>
<!--<p>[[${url}]]</p>-->
<div th:replace="zdyyj :: myfooter"></div>
<th:block th:include="include :: footer"/>
<script th:src="@{/ruoyi/js/jquery-confirm.min.js}"></script>
<script th:src="@{/ruoyi/js/jquery.form.js}"></script>
<script th:inline="javascript">
    var gsid="";
    var ypdx = [[${session.ypdx}]]
    var ipdz = [[${session.ipdz}]]
    var macdz = [[${session.macdz}]]
    var username=[[${session.username}]]
    var bm=[[${session.bm}]]
    $(document).ready(function () {
        $('#ypdx_update_1').val(ypdx.split('\+')[0])
        $('#ypdx_update_2').val(ypdx.split('\+')[1])
        $('#ypdx_update_3').val(ypdx.split('\+')[2])
        $('#ipdz1').val(ipdz.split('\.')[0])
        $('#ipdz2').val(ipdz.split('\.')[1])
        $('#ipdz3').val(ipdz.split('\.')[2])
        $('#ipdz4').val(ipdz.split('\.')[3])
        $('.mac1').val(macdz.split('\-')[0])
        $('.mac2').val(macdz.split('\-')[1])
        $('.mac3').val(macdz.split('\-')[2])
        $('.mac4').val(macdz.split('\-')[3])
        $('.mac5').val(macdz.split('\-')[4])
        $('.mac6').val(macdz.split('\-')[5])
        gsid=$("#pgsid").text()
        getDepts("#bmid_id");
        $('#bmid_id').val(bm)
        if (gsid == "") {
            $.alert("当前状态未登陆系统或浏览器中当前会话结束了，您需要重新登陆","温馨提示")
            window.location.href = "/login";
        }
    });
    $(function () {
    layui.use('laydate', function () {
        var laydate = layui.laydate;
        laydate.render({
            elem: '#gmrq_update',
            type: 'date',
            trigger: 'click'
        });
    });});

    $(function () {
        layui.use('laydate', function () {
            var laydate = layui.laydate;
            laydate.render({
                elem: '#xsqgmrq_update',
                type: 'date',
                trigger: 'click'
            });
        });
    });

    function getDepts(ele) {
        $.ajax({
            url: "/sbgl/ygxxb/getbm/" + gsid,
            type: 'get',
            async: false,
            success: function (data) {
                $(ele).empty();
                var options = "";   //字符串拼接
                $(ele).append('<option value="">请选择部门</option>');
                for (var i in data) {  //遍历json数组
                    options += "<option value='" + data[i].bm + "'>" + data[i].bm + "</option>"
                    //     // "<input type='radio' class='roles' name='roles' id='"+data[i].wjdcs+"' value='"+data[i].wjdc+"'>"+data[i].wjdc+"&nbsp;&nbsp;"
                }
                $(ele).append(options);
            },
        });
    };

    function getry() {
        var bm = $("#bmid_id option:selected").val();
        $('#shiyr_id').val("");
        $('#browsers').empty();
        $.ajax({
            url: "/sbgl/ygxxb/getygxx/" + bm,
            type: 'get',
            async: false,
            success: function (data) {
                $('#shiyr_id').empty();
                var options = "";   //字符串拼接
                for (var i in data) {  //遍历json数组
                    options += "<option value='" + data[i].shiyr + "'>" + data[i].zjm + "</option>"
                    //     // "<input type='radio' class='roles' name='roles' id='"+data[i].wjdcs+"' value='"+data[i].wjdc+"'>"+data[i].wjdc+"&nbsp;&nbsp;"
                }
                $('#browsers').append(options);
            },
        });
    }

    /**
     * mac发生变化时调用即可
     * 将每一个小格中的值获取到传给后台
     * 如果小格中没有值则传空值，有值则传value值，并在后面加上：封号，最后一个不用加
     * */
    function macc() {
        var mac1, mac2, mac3, mac4, mac5, mac6;
        if ($("#macdz_id>.mac1").val() == '') {
            mac1 = '';
        } else {
            mac1 = $("#macdz_id>.mac1").val() + '-';
        }
        if ($("#macdz_id>.mac2").val() == '') {
            mac2 = '';
        } else {
            mac2 = $("#macdz_id>.mac2").val() + '-';
        }
        if ($("#macdz_id>.mac3").val() == '') {
            mac3 = '';
        } else {
            mac3 = $("#macdz_id>.mac3").val() + '-';
        }
        if ($("#macdz_id>.mac4").val() == '') {
            mac4 = '';
        } else {
            mac4 = $("#macdz_id>.mac4").val() + '-';
        }
        if ($("#macdz_id>.mac5").val() == '') {
            mac5 = '';
        } else {
            mac5 = $("#macdz_id>.mac5").val() + '-';
        }
        if ($("#macdz_id>.mac6").val() == '') {
            mac6 = '';
        } else {
            mac6 = $("#macdz_id>.mac6").val();
        }
        var macc = mac1 + mac2 + mac3 + mac4 + mac5 + mac6;
        $("#mac").val(macc);
    }

    /**
     * ip发生变化时调用即可
     * 同Mac一样
     * */
    function ipp() {
        var ip1, ip2, ip3, ip4;
        if ($("#ipdz_id>.ip1").val() == '') {
            ip1 = '';
        } else {
            ip1 = $("#ipdz_id>.ip1").val() + '.';
        }
        if ($("#ipdz_id>.ip2").val() == '') {
            ip2 = '';
        } else {
            ip2 = $("#ipdz_id>.ip2").val() + '.';
        }
        if ($("#ipdz_id>.ip3").val() == '') {
            ip3 = '';
        } else {
            ip3 = $("#ipdz_id>.ip3").val() + '.';
        }
        if ($("#ipdz_id>.ip4").val() == '') {
            ip4 = '';
        } else {
            ip4 = $("#ipdz_id>.ip4").val();
        }
        var ipp = ip1 + ip2 + ip3 + ip4;
        $("#ip").val(ipp);
    }

    /**
     * mac地址格式
     * 键盘按方向键上下左右，光标在四个input中来回切换
     */
    $('#macdz_id>input').each(function (i, o) {
        $(this).attr('cust_index', i);
    })

    $('#macdz_id>input').keydown(function (event) {
        var keycode = event.which;
        //从最后一个小格开始删除，删完之后直接跳到前一个小格中继续删除
        if (event.keyCode == 8 && $(this).val().length == 0) {
            $(this).prev().focus();
        }
        if (38 != keycode && 40 != keycode && 37 != keycode && 39 != keycode) {
            return;
        }
        var ti = $(this).attr('cust_index');
        if (39 == keycode || 40 == keycode) {
            //down
            ti++;
        } else {
            //up
            ti--;
        }
        if (ti < 0) {
            ti = 0;
        }
        var next_obj = $('#macdz_id>input[cust_index=' + ti + ']');
        if (next_obj) {
            next_obj.focus();
        }
    })

    /**
     * 限制mac输入，以及跳下一格的条件
     * */
    $('#macdz_id>input').bind('input propertychange', function () {
        //限制mac只能输入数字母
        var c = $(this);
        //截取输入的最后一个字符
        var lastStr = c.val().substr(c.val().trim().length - 1, 1);
        if (/[^\w]/.test(c.val())) {
            //替换非字母和数字字符，当输入不是字母或数字的时候用空替换
            var temp_amount = c.val().replace(/[^\w]/g, '');
            $(this).val(temp_amount);
            // 当前小格输入的最后一个字符是.并且长度不等于空
            if (/[-]/.test(lastStr) && $(this).val() != '') {
                $(this).next().focus();
            }
        }
        //当前小格输入长度为2时自动跳到下一格
        if ($(this).val().trim().length == 2) {
            $(this).next().focus();
        }
    })

    $('#macdz_id>input').bind('blur', function () {
        if ($(this).val().trim().length < 2) {
            $(this).focus();
            return false;
        }
        macc();
    })

    $('#macdz_id>.mac6').bind('blur', function () {
        if ($("#macdz_id>.mac6").val().trim().length < 2) {
            $("#macdz_id>.mac6").focus();
            return false;
        }
        macc();
    })

    /**
     * 限制ip输入，以及跳下一格的条件
     * */
    $('#ipdz_id>input').bind('input propertychange', function () {
        // 输入不是数字的时候清空
        var c = $(this);
        //截取输入的最后一个字符
        var lastStr = c.val().substr(c.val().trim().length - 1, 1);
        if (/[^\d]/.test(c.val())) {
            //替换非数字字符
            var temp_amount = c.val().replace(/[^\d]/g, '');
            $(this).val(temp_amount);
            // 当前小格输入的最后一个字符是.并且长度不等于空
            if (/[.]/.test(lastStr) && $(this).val() != '') {
                $(this).next().focus();
            }
        }
        // 第二，三，四位输入不在0-255之间的时候清空
        if ($(this).val() < 0 || $(this).val() > 255) {
            $(this).val('');
        }
        //第一位输入不在1-223之间的时候清空
        if ($("#ipdz_id>.ip1").val() < 1 || $("#ipdz_id>.ip1").val() > 223) {
            $("#ipdz_id>.ip1").val('');
        }
        //当每一小格输入的长度等于3时，自动跳到下一个
        if ($(this).val().trim().length == 3) {
            $(this).next().focus();
        }
        ipp();
    })

    /**
     * ip地址格式
     * 键盘按方向键上下左右，光标在四个input中来回切换
     */
    $('#ipdz_id>input').each(function (i, o) {
        $(this).attr('cust_index', i);
    })


    $('#ipdz_id>input').keydown(function (event) {
        var keycode = event.which;
        //从最后一个小格开始删除，删完之后直接跳到前一个小格中继续删除
        if (event.keyCode == 8 && $(this).val().length == 0) {
            $(this).prev().focus();
        }
        if (38 != keycode && 40 != keycode && 37 != keycode && 39 != keycode) {
            return;
        }
        var ti = $(this).attr('cust_index');
        if (39 == keycode || 40 == keycode) {
            //down
            ti++;
        } else {
            //up
            ti--;
        }
        if (ti < 0) {
            ti = 0;
        }
        var next_obj = $('#ipdz_id>input[cust_index=' + ti + ']');
        if (next_obj) {
            next_obj.focus();
        }
    })

    function updatesb() {
        var sbbh = $('#sbbh_update').val()
        var sbmc = $('#sbmc_update').val()
        var ipdz1 = $("#ipdz1").val()
        var ipdz2 = $("#ipdz2").val()
        var ipdz3 = $("#ipdz3").val()
        var ipdz4 = $("#ipdz4").val()
        var macdz1 = $(".mac1").val()
        var macdz2 = $(".mac2").val()
        var macdz3 = $(".mac3").val()
        var macdz4 = $(".mac4").val()
        var macdz5 = $(".mac5").val()
        var macdz6 = $(".mac6").val()
        $("#ip").val(ipdz1+"."+ipdz2+"."+ipdz3+"."+ipdz4);
        $("#mac").val(macdz1+"-"+macdz2+"-"+macdz3+"-"+macdz4+"-"+macdz5+"-"+macdz6);
        if (sbmc.indexOf("脑") > 0 || sbmc.indexOf("务器") > 0) {
            if (ipdz1 == "" || ipdz2 == "" || ipdz3 == "" || ipdz4 == "") {
                $.alert("IP地址错误，请检查","温馨提示")
            } else if (macdz1.length != 2 || macdz2.length != 2 || macdz3.length != 2 || macdz4.length != 2 || macdz5.length != 2 || macdz6.length != 2) {
                $.alert("MAC地址错误，请检查","温馨提示")
            }else {
                tishi(sbbh)
            }
        } else {
            tishi(sbbh)
        }
    }

    function tishi(sbbh) {
        $.confirm({
            title: '温馨提示',
            content: '更新设备信息吗？？？',
            buttons: {
                确定: {
                    text: '确定',
                    btnClass: 'btn-blue',
                    action: function () {
                        return $.ajax({
                            url: '/sbgl/sbxxb/updatesb/' + sbbh,
                            method: 'put',
                            async: false,
                            data: $("#form-sb-add").serialize()
                        }).done(function (response) {
                            window.location.href = "/sbgl/sbxxb/sbxxb"
                        }).fail(function () {
                        });
                    }
                },
                取消: {
                    text: '取消',
                    btnClass: 'btn-red',
                    action: function () {
                    },
                },
            },
        });
    }

    function confirm(title,content,ele) {
        $.confirm({
            title: title,
            content: content,
            buttons: {
                确定: {
                    text: '确定',
                    btnClass: 'btn-white',
                    action: function(){
                        $(ele).modal('hide');
                    }
                }
            }
        });
    }

    $("#guige_update").bind("input propertychange", function () {
        document.getElementById("guige_update").style.color = "red"
    });

    $("#shccj_update").bind("input propertychange", function () {
        document.getElementById("shccj_update").style.color = "red"
    });

    $("#gmrq_update").bind("input propertychange", function () {
        document.getElementById("gmrq_update").style.color = "red"
    });

    $("#zbxh_update").bind("input propertychange", function () {
        document.getElementById("zbxh_update").style.color = "red"
    });

    $("#cpuxh_update").bind("input propertychange", function () {
        document.getElementById("cpuxh_update").style.color = "red"
    });

    $("#xsqppcc_update").bind("input propertychange", function () {
        document.getElementById("xsqppcc_update").style.color = "red"
    });

    $("#xkxh_update").bind("input propertychange", function () {
        document.getElementById("xkxh_update").style.color = "red"
    });

    $("#bmid_update").bind("input propertychange", function () {
        document.getElementById("bmid_update").style.color = "red"
    });

    $("#shiyr_update").bind("input propertychange", function () {
        document.getElementById("shiyr_update").style.color = "red"
    });

    $("#ncggdx_update").bind("input propertychange", function () {
        document.getElementById("ncggdx_update").style.color = "red"
    });

    $("#ypdx_update_1").bind("input propertychange", function () {
        document.getElementById("ypdx_update_1").style.color = "red"
        if ($("#ypdx_update_1").val() == "") {
            document.getElementById("ypdx1lab").style.color = "red";
        }
    });

    $("#ypdx_update_2").bind("input propertychange", function () {
        document.getElementById("ypdx_update_2").style.color = "red"
        if ($("#ypdx_update_2").val() == "") {
            document.getElementById("ypdx2lab").style.color = "red";
        }
    });

    $("#ypdx_update_3").bind("input propertychange", function () {
        document.getElementById("ypdx_update_3").style.color = "red"
        if ($("#ypdx_update_3").val() == "") {
            document.getElementById("ypdx3lab").style.color = "red";
        }
    });

    $("#beiz_update").bind("input propertychange", function () {
        document.getElementById("beiz_update").style.color = "red"
    });

    $("#sjbeiz_update").bind("input propertychange", function () {
        document.getElementById("sjbeiz_update").style.color = "red"
    });

    $("#bfbeiz_update").bind("input propertychange", function () {
        document.getElementById("bfbeiz_update").style.color = "red"
    });

    $("#ipdz_id").bind("input propertychange", function () {
        document.getElementById("ipdz_id").style.color = "red"
    });

    $("#macdz_id").bind("input propertychange", function () {
        document.getElementById("macdz_id").style.color = "red"
    });
</script>
</body>
</html>